﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VirtualPress.Infrastructure.Entities.Repository;
using VirtualPress.Infrastructure.Entities.Enum;

namespace VirtualPress.Infrastructure.Entities.Entity
{
    public class Meeting : IAccessible<T_Meeting, Meeting>, ILogicEntity<T_Meeting, Meeting>
    {
        #region Fileds
        public int Id { get; set; }

        public string Name { get; set; }
        public string Name_EN { get; set; }
        /// <summary>
        /// 期刊缩写
        /// </summary>
        public string ShortName { get; set; }
        /// <summary>
        /// 管理员账户
        /// </summary>
        public string Admin { get; set; }

        /// <summary>
        /// 行业分类
        /// </summary>
        public Profession IndType { get; set; }
        /// <summary>
        /// 出版社_Id
        /// </summary>
        public int Press_Id { get; set; }
        /// <summary>
        /// 联系信息
        /// </summary>
        public string ContactInfo { get; set; }
        public string Fax { get; set; }
        public string ZBDW { get; set; }
        public string CBDW { get; set; }
        /// <summary>
        /// 会议规模
        /// </summary>
        public string HYGM { get; set; }
        public string ZGFW { get; set; }
        /// <summary>
        /// 联系邮箱
        /// </summary>
        public string Email { get; set; }
        /// <summary>
        /// 摘要
        /// </summary>
        public string Abstract { get; set; }
        /// <summary>
        /// 会议详情
        /// </summary>
        public string About { get; set; }
        /// <summary>
        /// 征稿启事
        /// </summary>
        public string CallForPaper { get; set; }
        /// <summary>
        /// 作者须知
        /// </summary>
        public string Attention { get; set; }
        /// <summary>
        /// 会议日期
        /// </summary>
        public DateTime StartDate { get; set; }
        /// <summary>
        /// 截稿日期
        /// </summary>
        public DateTime ArticleEndDate { get; set; }
        /// <summary>
        /// 会后旅游
        /// </summary>
        public string Travel { get; set; }
        /// <summary>
        /// 日程安排
        /// </summary>
        public string Schedule { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int Status { get; set; }
        public string Address { get; set; }
        /// <summary>
        /// 会议集信息
        /// </summary>
        public string Catalog { get; set; }
        public bool isActive { get; set; }
        /// <summary>
        /// 是否已经初始化
        /// </summary>
        public bool isInstall { get; set; }
        /// <summary>
        /// 会议外链地址
        /// </summary>
        public string Link { get; set; }
        /// <summary>
        /// 默认审回时间
        /// </summary>
        public int DefaultExamineDay { get; set; }
        public int ManuscriptPageSize { get; set; }
        /// <summary>
        /// 是否收取专审费
        /// </summary>
        public bool isFeeForExpertExmaine { get; set; }
        public int PagePrice { get; set; }
        public int PricePerPrice { get; set; }
        /// <summary>
        /// 出版费
        /// </summary>
        public int PublicationPrice { get; set; }
        public string Logo { get; set; }
        public string Css { get; set; }
        public int DownloadNumber { get; set; }
        public int VisitNumber { get; set; }
        public string GroupName { get; set; }
        /// <summary>
        /// 组委会
        /// </summary>
        public string Committee { get; set; }
        /// <summary>
        /// 联系我们
        /// </summary>
        public string AboutUs { get; set; }

        public string Keyword { get; set; }

        public string Description { get; set; }
        #endregion

        protected override void Covariant(T_Meeting model)
        {
            if (model != null)
            {
                this.Keyword = model.Keyword;
                this.Description = model.Description;
                this.Committee = model.Committee;
                this.AboutUs = model.AboutUs;
                this.DefaultExamineDay = model.DefaultExamineDay;
                this.ManuscriptPageSize = model.ManuscriptPageSize;
                this.isFeeForExpertExmaine = model.IsFeeForExpertExmaine;
                this.PagePrice = model.PagePrice;
                this.PricePerPrice = model.PricePerPrice;
                this.PublicationPrice = model.PublicationPrice;
                this.Abstract = model.Abstract;
                this.Admin = model.Admin;
                this.About = model.About;
                this.CBDW = model.CBDW;
                this.ContactInfo = model.ContactInfo;
                this.Email = model.Email;
                this.Fax = model.Fax;
                this.HYGM = model.HYGM;
                this.Id = model.Id;
                this.IndType = (Profession)model.IndType;
                this.isActive = model.isActive;
                this.Link = model.Link;
                this.Name = model.Name;
                this.Name_EN = model.Name_EN;
                this.Press_Id = model.Press_Id;
                this.ShortName = model.ShortName;
                this.ZBDW = model.ZBDW;
                this.ZGFW = model.ZGFW;
                this.Logo = model.Logo;
                this.Css = model.Css;
                this.DownloadNumber = model.DownloadNumber;
                this.VisitNumber = model.VisitNumber;
                this.CallForPaper = model.CallForPaper;
                this.Attention = model.Attention;
                this.StartDate = model.StartDate;
                this.ArticleEndDate = model.ArticleEndDate;
                this.Travel = model.Travel;
                this.Schedule = model.Schedule;
                this.Status = model.Status;
                this.Address = model.Address;
                this.Catalog = model.Catalog;
                this.isInstall = model.isInstall;
                this.GroupName = model.GroupName;
            }
        }

        protected override T_Meeting Inverter(Meeting model)
        {
            if (model != null)
            {
                return new T_Meeting()
                {
                    Keyword=model.Keyword,
                    Description=model.Description,
                    AboutUs=model.AboutUs,
                    Committee=model.Committee,
                    DefaultExamineDay = model.DefaultExamineDay,
                    ManuscriptPageSize = model.ManuscriptPageSize,
                    IsFeeForExpertExmaine = model.isFeeForExpertExmaine,
                    PagePrice = model.PagePrice,
                    PricePerPrice = model.PricePerPrice,
                    PublicationPrice = model.PublicationPrice,
                    Abstract = model.Abstract,
                    Admin = model.Admin,
                    CBDW = model.CBDW,
                    Email = model.Email,
                    Fax = model.Fax,
                    HYGM = model.HYGM,
                    Id = model.Id,
                    IndType = (int)model.IndType,
                    isActive = model.isActive,
                    Link = model.Link,
                    Name = model.Name,
                    Name_EN=model.Name_EN,
                    Press_Id = model.Press_Id,
                    ShortName = model.ShortName,
                    ZBDW = model.ZBDW,
                    Css = model.Css,
                    Logo = model.Logo,
                    DownloadNumber = model.DownloadNumber,
                    VisitNumber = model.VisitNumber,
                    ZGFW = model.ZGFW,
                    CallForPaper = model.CallForPaper,
                    Attention = model.Attention,
                    Address = model.Address,
                    ArticleEndDate = model.ArticleEndDate,
                    About = model.About,
                    Catalog = model.Catalog,
                    ContactInfo = model.ContactInfo,
                    isInstall = model.isInstall,
                    Schedule = model.Schedule,
                    StartDate = model.StartDate,
                    Status = model.Status,
                    Travel = model.Travel,
                    GroupName = model.GroupName
                };
            }
            return null;
        }

        public Meeting Set(T_Meeting dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
